package com.otp.model.test.template;

// Generated Apr 8, 2012 1:44:44 PM by Hibernate Tools 3.4.0.CR1

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.appfuse.model.BaseObject;

/**
 * TestTemplate generated by hbm2java
 */
@Entity
@Table(name = "report_templates", uniqueConstraints = @UniqueConstraint(columnNames = "short_description"))
public class ReportTemplate extends BaseObject implements Serializable {

	private static final long serialVersionUID = 1L;
	private int objectId;
	private String shortDescription;
	private String longDescription;
	private boolean showMaxScore;
	private boolean showRawScore;
	private boolean showPercentageScore;
	private boolean showZetaScore;
	private boolean showPercentileRank;
	private boolean showStenScore;
	private boolean showThetaEAP;
	private boolean showThetaML;
	private boolean showThetaMAP;
	private boolean showErrorEAP;
	private boolean showErrorML;
	private boolean showErrorMAP;
	private String pdfTemplateFile;
	private Set<ReportCriteria> reportCriteria = new HashSet<ReportCriteria>();


	@OneToMany(fetch=FetchType.EAGER)
	@JoinColumn(name="fk2report_template")
	public Set<ReportCriteria> getReportCriteria() {
		return reportCriteria;
	}

	public void setReportCriteria(Set<ReportCriteria> reportCriteria) {
		this.reportCriteria = reportCriteria;
	}

	public ReportTemplate() {
	}

	public ReportTemplate(int objectId) {
		this.objectId = objectId;
	}

	@Id
	@Column(name = "object_id", unique = true, nullable = false)
	public int getObjectId() {
		return this.objectId;
	}

	public void setObjectId(int objectId) {
		this.objectId = objectId;
	}

	@Column(name = "show_max_score")
	public boolean isShowMaxScore() {
		return showMaxScore;
	}

	public void setShowMaxScore(boolean showMaxScore) {
		this.showMaxScore = showMaxScore;
	}

	@Column(name = "show_raw_score")
	public boolean isShowRawScore() {
		return showRawScore;
	}

	public void setShowRawScore(boolean showRawScore) {
		this.showRawScore = showRawScore;
	}
	
	@Column(name = "show_percentage_score")
	public boolean isShowPercentageScore() {
		return showPercentageScore;
	}

	public void setShowPercentageScore(boolean showPercentageScore) {
		this.showPercentageScore = showPercentageScore;
	}
	
	@Column(name = "show_zScore")
	public boolean isShowZetaScore() {
		return showZetaScore;
	}

	public void setShowZetaScore(boolean showZScore) {
		this.showZetaScore = showZScore;
	}

	@Column(name = "show_percentile_rank")
	public boolean isShowPercentileRank() {
		return showPercentileRank;
	}

	public void setShowPercentileRank(boolean showPercentileRank) {
		this.showPercentileRank = showPercentileRank;
	}

	@Column(name = "show_sten_score")
	public boolean isShowStenScore() {
		return showStenScore;
	}

	public void setShowStenScore(boolean showStenScore) {
		this.showStenScore = showStenScore;
	}
	
	@Column(name = "show_thetaEAP")
	public boolean isShowThetaEAP() {
		return showThetaEAP;
	}

	public void setShowThetaEAP(boolean showThetaEAP) {
		this.showThetaEAP = showThetaEAP;
	}
	
	@Column(name = "show_thetaML")
	public boolean isShowThetaML() {
		return showThetaML;
	}

	public void setShowThetaML(boolean showThetaML) {
		this.showThetaML = showThetaML;
	}
	
	@Column(name = "show_thetaMAP")
	public boolean isShowThetaMAP() {
		return showThetaMAP;
	}

	public void setShowThetaMAP(boolean showThetaMAP) {
		this.showThetaMAP = showThetaMAP;
	}

	@Column(name = "show_errorEAP")
	public boolean isShowErrorEAP() {
		return showErrorEAP;
	}

	public void setShowErrorEAP(boolean showErrorEAP) {
		this.showErrorEAP = showErrorEAP;
	}
	
	@Column(name = "show_errorML")
	public boolean isShowErrorML() {
		return showErrorML;
	}

	public void setShowErrorML(boolean showErrorML) {
		this.showErrorML = showErrorML;
	}
	
	@Column(name = "show_errorMAP")
	public boolean isShowErrorMAP() {
		return showErrorMAP;
	}

	public void setShowErrorMAP(boolean showErrorMAP) {
		this.showErrorMAP = showErrorMAP;
	}

	@Column(name = "short_description", unique = true)
	public String getShortDescription() {
		return this.shortDescription;
	}

	public void setShortDescription(String shortDescription) {
		this.shortDescription = shortDescription;
	}

	@Column(name = "long_description")
	public String getLongDescription() {
		return this.longDescription;
	}
	
	public void setPdfTemplateFile(String pdfTemplateFile) {
		this.pdfTemplateFile = pdfTemplateFile;
	}

	@Column(name = "xslt_file")
	public String getPdfTemplateFile() {
		return this.pdfTemplateFile;
	}


	public void setLongDescription(String longDescription) {
		this.longDescription = longDescription;
	}

	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (!(o instanceof ReportTemplate)) {
			return false;
		}

		final ReportTemplate reportTemplate = (ReportTemplate) o;

		return !(shortDescription != null ? !shortDescription.equals(reportTemplate.getShortDescription()) : reportTemplate.getShortDescription() != null);

	}

	 public int hashCode() {
		 return (shortDescription != null ? shortDescription.hashCode() : 0);
	 }

	 
	 public String toString() {
		 ToStringBuilder sb = new ToStringBuilder(this, ToStringStyle.DEFAULT_STYLE)
		 .append("report template", this.shortDescription);

		 return sb.toString();
	 }


}
